<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Tag;
use Illuminate\Support\Str;

class TagSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $tags = [
            [
                'name' => 'Laravel',
                'slug' => 'laravel',
                'description' => 'Laravel PHP框架相关内容',
            ],
            [
                'name' => 'PHP',
                'slug' => 'php',
                'description' => 'PHP编程语言相关内容',
            ],
            [
                'name' => 'JavaScript',
                'slug' => 'javascript',
                'description' => 'JavaScript编程语言相关内容',
            ],
            [
                'name' => 'Vue.js',
                'slug' => 'vuejs',
                'description' => 'Vue.js前端框架相关内容',
            ],
            [
                'name' => 'MySQL',
                'slug' => 'mysql',
                'description' => 'MySQL数据库相关内容',
            ],
            [
                'name' => 'Docker',
                'slug' => 'docker',
                'description' => 'Docker容器化技术相关内容',
            ],
            [
                'name' => 'Git',
                'slug' => 'git',
                'description' => 'Git版本控制相关内容',
            ],
            [
                'name' => 'API',
                'slug' => 'api',
                'description' => 'API接口开发相关内容',
            ],
            [
                'name' => '前端开发',
                'slug' => 'frontend',
                'description' => '前端开发技术相关内容',
            ],
            [
                'name' => '后端开发',
                'slug' => 'backend',
                'description' => '后端开发技术相关内容',
            ],
            [
                'name' => '数据库设计',
                'slug' => 'database-design',
                'description' => '数据库设计和优化相关内容',
            ],
            [
                'name' => '性能优化',
                'slug' => 'performance',
                'description' => '系统性能优化相关内容',
            ],
        ];

        foreach ($tags as $tagData) {
            Tag::firstOrCreate(
                ['slug' => $tagData['slug']],
                $tagData
            );
        }
    }
}